10 while (cin
>> n
>> row
>> col
&& n
){
11 for (int i
=0; i
<n
; ++i
) cin
>> f
[i
][0];
12 for (int j
=0; j
<(n
+1); ++j
) f
[0][j
] = f
[n
-1][j
] = 1;
13 for (int j
=1; j
<(n
+1); ++j
)
14 for (int i
=1; i
<n
-1; ++i
)
15 f
[i
][j
] = (f
[i
+1][j
-1]*f
[i
-1][j
]+1)/f
[i
][j
-1];
18 cout
<< f
[row
][col
%(n
+1)] << endl
;